package com.waimai1.waimai.service;

import com.alibaba.fastjson.JSONObject;
import com.waimai1.waimai.entity.MyOrder;

import com.wechat.pay.java.service.partnerpayments.app.model.Transaction;
import com.wechat.pay.java.service.partnerpayments.jsapi.model.PrepayResponse;
import com.wechat.pay.java.service.profitsharing.model.*;
import com.wechat.pay.java.service.refund.model.Refund;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;

public interface LocalWepayService {
    /** JSAPI支付下单 */
    PrepayResponse localPrepay(int totalFee, String openid, String tradeNo,Integer shopId,boolean fenzhang);
     //退款
    Refund refund(String out_trade_no, Long totalAmount,Long refundAmount);
//    /** 关闭订单 */
//    void closeOrder();
//    /** 微信支付订单号查询订单 */
//     Transaction queryOrderById();
    /** 商户订单号查询订单 */
//    Transaction queryOrderByOutTradeNo(String OutTradeNo);
    //获取notify的解密resource
    JSONObject getResource(HttpServletRequest request) throws IOException, GeneralSecurityException;
//    全额退款
    void allRefund(MyOrder order);
//    添加分账方
AddReceiverResponse addReceiver(String subMchid, ReceiverType type, String account, ReceiverRelationType relationType);
//     分账
    OrdersEntity createFenzhang(String subMchid, String transaction_id, String out_order_no, ArrayList<CreateOrderReceiver> receivers);
}
